package com.es.mapper;

import com.es.entity.StudentDO;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

/**
 * 描述:
 * es-meta-
 *
 * @author Derek
 * @create 2021-11-30 10:32
 */
@Mapper
public interface StudentMapper {

    /**
     * @return
     */
    @Select("select id,name,age,address,birthday,balance from student")
    List<StudentDO> list();

    @Insert("insert into student (id,name,age,address,balance) values (null,#{name},#{age},#{address},#{balance}) ")
    int save(StudentDO studentDO);

    /**
     * @param id
     * @return
     */
    @Select("select id,name,age,address,birthday,balance from student where id =#{id}")
    StudentDO get(@Param("id") Integer id);

}
